#include <iostream>
#include <string>
using namespace std;
class Query
{
    friend Query operator ~(const Query &);
    friend Query operator |(const Query &, Query &);
    friend Query operator &(const Query &, Query &);
public:
    Query(const string &);

private:
    Query_base *query_base;
};
class Query_base
{
    friend class Query;
    protected:
    virtual ~Query_base() = default;
    private:
    virtual QueryResult eval(const TextQuery &) const = 0;
    virtual string rep() const = 0;
};
class TextQuery
{
};
class QueryResult
{
};

void test()
{
}
int main()
{
    test();
    return 0;
}
